package com.lollipop.synthential.java8.lambda.syntax.Closure;

import java.util.function.Supplier;

/**
 * @Author: J.K
 * @Date: 2021-02-16 16:06
 * @Description:
 */
public class ClosureDemo {
    public static void main(String[] args) {
        Integer n = getNumber().get();
        System.out.println(n);
    }

    private static Supplier<Integer> getNumber() {

        int num = 10;
        return () -> {
            return num;
        };
    }
}
